/**
 * @file wa_iconlist.h
 *
 */

#ifndef _WA_ICONLIST_H
#define _WA_ICONLIST_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/
#include "wa_conf.h"
#if USE_WA_ICONLIST != 0
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "wa_area.h"
#include "wa_obj.h"
#include "wa_mask_draw.h"
#include "wa_wm.h"
#include "wa_font.h"
#include "wa_image.h"
#include "wa_anim.h"
#include "wa_malloc.h"
/*********************
*      DEFINES
*********************/


/**********************
*      TYPEDEFS
**********************/
typedef enum
{
	WA_ICONLIST_ROLL_TYPE_HOR,
	WA_ICONLIST_ROLL_TYPE_VER,
}wa_iconlist_roll_type;

typedef enum
{
	WA_ICONLIST_TEXT_TYPE_NORMAL_HOR,
	WA_ICONLIST_TEXT_TYPE_NORMAL_VER,
	WA_ICONLIST_TEXT_TYPE_FREEDOM,
}wa_iconlist_text_type;

typedef struct
{
#if USE_WA_ANIM != 0
	wa_anim* anim;
#endif
	wa_result anim_enable;
	uint32_t switch_time_length;

	wa_iconlist_roll_type roll_type;
	wa_bitmap** option_bitmap;
	char** option_text;
	uint32_t option_cnt;
	wa_font* text_font;

	wa_gui_color fore_color;
	wa_gui_color back_color;

	uint32_t select;
	uint8_t space;

	int32_t roll_pos;
	int32_t roll_rel_x;
	int32_t roll_rel_y;
	int32_t roll_w;
	int32_t roll_h;

	wa_iconlist_text_type text_type;
	int32_t text_rel_x;
	int32_t text_rel_y;
	int32_t text_s_x;
	int32_t text_s_y;
	int32_t text_pos_x;
	int32_t text_pos_y;

	wa_result arrow_enable;
	uint32_t arrow_w;
	uint32_t arrow_h;
	uint32_t arrow_interval;

	wa_result pid;
	wa_result input;
}wa_iconlist_ext;

/**********************
* GLOBAL PROTOTYPES
**********************/
void wa_iconlist_module_init(void);
wa_obj* wa_iconlist_create(wa_obj* par);
void wa_iconlist_add_option(wa_obj* iconlist, wa_bitmap* bitmap, char* text);
void wa_iconlist_clear_option(wa_obj* iconlist);
void wa_iconlist_set_anim_enable(wa_obj* iconlist, wa_result anim_enable);
wa_result wa_iconlist_get_anim_enable(wa_obj* iconlist);
void wa_iconlist_set_switch_time_length(wa_obj* iconlist, uint32_t time);
uint32_t wa_iconlist_get_switch_time_length(wa_obj* iconlist);
void wa_iconlist_set_roll_type(wa_obj* iconlist, wa_iconlist_roll_type roll_type);
wa_iconlist_roll_type wa_iconlist_get_roll_type(wa_obj* iconlist);
void wa_iconlist_set_text_font(wa_obj* iconlist, wa_font* font);
wa_font* wa_iconlist_get_tex_font(wa_obj* iconlist);
void wa_iconlist_set_fore_color(wa_obj* iconlist, wa_gui_color fore_color);
wa_gui_color wa_iconlist_get_fore_color(wa_obj* iconlist);
void wa_iconlist_set_back_color(wa_obj* iconlist, wa_gui_color back_color);
wa_gui_color wa_iconlist_get_back_color(wa_obj* iconlist);
void wa_iconlist_set_select(wa_obj* iconlist, uint32_t select);
uint32_t wa_iconlist_get_select(wa_obj* iconlist);
void wa_iconlist_set_space(wa_obj* iconlist, uint32_t space);
uint8_t wa_iconlist_get_space(wa_obj* iconlist);
void wa_iconlist_set_roll_rect(wa_obj* iconlist, int32_t x, int32_t y, int32_t w, int32_t h);
void wa_iconlist_set_text_type(wa_obj* iconlist, wa_iconlist_text_type text_type);
wa_iconlist_text_type wa_iconlist_get_text_type(wa_obj* iconlist);
void wa_iconlist_set_text_pos(wa_obj* iconlist, int32_t sx, int32_t sy, int32_t ex, int32_t ey);
void wa_iconlist_set_arrow_enable(wa_obj* iconlist, wa_result enable);
wa_result wa_iconlist_get_arrow_enable(wa_obj* iconlist);
void wa_iconlist_set_arrow_size(wa_obj* iconlist, int32_t w, int32_t h, int32_t interval);
void wa_iconlist_init_select_pos(wa_obj* iconlist);

/**********************
*      MACROS
**********************/

#endif

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif



